﻿#ifndef _FD_MODELDATASTREAM_H_
#define _FD_MODELDATASTREAM_H_ 

#include "../dll_cfg.h"
#include "kernel/OgreDataStream.h"

namespace FD
{
	namespace Utility
	{
		namespace Dataset
		{
			FD::Kernel::MemoryDataStreamPtr cloneMemPtr(const FD::Kernel::MemoryDataStreamPtr& buffer);

			class FD_XDataset_Export ModelDataStream
			{
			public:
				ModelDataStream()
				{
					mIsFBX = false;
				}

				typedef map<UINT32, FD::Kernel::MemoryDataStreamPtr> MeshDataSteamVec;
				MeshDataSteamVec mMeshDataStreamVec;
				FD::Kernel::MemoryDataStreamPtr mNodeTree;

				typedef vector<FD::Kernel::MemoryDataStreamPtr> SharedTextureVec;
				SharedTextureVec mSharedOrigTexDataStreamVec;
				SharedTextureVec mSharedThumbTexDataStreamVec;

				FD::Kernel::MemoryDataStreamPtr mSharedMaterialDataStream;
				FD::Kernel::MemoryDataStreamPtr mSkeletonDataStream;
				FD::Kernel::MemoryDataStreamPtr mMexDataStream;

			public:
				bool mIsFBX;
				//end add by zk 
			public:
				ModelDataStream clone();

				void parseModelDataStream(const FD::Kernel::MemoryDataStreamPtr& stream, bool withTex=false);
				FD::Kernel::MemoryDataStreamPtr combineModelDataStream(bool withTex=false);

				void parseSharedOrigTexDataStream(const FD::Kernel::MemoryDataStreamPtr& stream);
				FD::Kernel::MemoryDataStreamPtr combineSharedOrigTexDataStream();

				void parseSharedThumbTexDataStream(const FD::Kernel::MemoryDataStreamPtr& stream);
				FD::Kernel::MemoryDataStreamPtr combineSharedThumbTexDataStream();

				void resetStream();
			};
		}
	}
}


#endif
